package com.meitianhui.convenitenbuy.module.wallet.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.chad.library.adapter.base.entity.MultiItemEntity;

/**
 * Created by Administrator on 2017/11/13.
 */

public class RedPacketBean implements MultiItemEntity,Parcelable {
    public static final int ITEM_ENABLE = 1;     //Enable
    public static final int ITEM_DISABLE = 2;  //会员相关权益
    private String activity_id;
    private String created_date;
    public String detail_id;
    private String expired_date;
    private String gift_type;
    private String gift_value;
    private String status;

    public RedPacketBean(String gift_type, String status) {
        this.gift_type = gift_type;
        this.status = status;
    }

    public String getActivity_id() {
        return activity_id;
    }

    public void setActivity_id(String activity_id) {
        this.activity_id = activity_id;
    }

    public String getCreated_date() {
        return created_date;
    }

    public void setCreated_date(String created_date) {
        this.created_date = created_date;
    }

    public String getDetail_id() {
        return detail_id;
    }

    public void setDetail_id(String detail_id) {
        this.detail_id = detail_id;
    }

    public String getExpired_date() {
        return expired_date;
    }

    public void setExpired_date(String expired_date) {
        this.expired_date = expired_date;
    }

    public String getGift_type() {
        return gift_type;
    }

    public void setGift_type(String gift_type) {
        this.gift_type = gift_type;
    }

    public String getGift_value() {
        return gift_value;
    }

    public void setGift_value(String gift_value) {
        this.gift_value = gift_value;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public int getItemType() {
        return status == null ? ITEM_ENABLE : status.equals("enable") ? ITEM_ENABLE : ITEM_DISABLE;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.activity_id);
        dest.writeString(this.created_date);
        dest.writeString(this.detail_id);
        dest.writeString(this.expired_date);
        dest.writeString(this.gift_type);
        dest.writeString(this.gift_value);
        dest.writeString(this.status);
    }

    protected RedPacketBean(Parcel in) {
        this.activity_id = in.readString();
        this.created_date = in.readString();
        this.detail_id = in.readString();
        this.expired_date = in.readString();
        this.gift_type = in.readString();
        this.gift_value = in.readString();
        this.status = in.readString();
    }

    public static final Creator<RedPacketBean> CREATOR = new Creator<RedPacketBean>() {
        @Override
        public RedPacketBean createFromParcel(Parcel source) {
            return new RedPacketBean(source);
        }

        @Override
        public RedPacketBean[] newArray(int size) {
            return new RedPacketBean[size];
        }
    };
}
